﻿CREATE PROCEDURE [Auth].[GetUserByUserName]
	@UserName NVARCHAR(255)
WITH EXECUTE AS OWNER
AS
SET NOCOUNT ON;

SELECT a.AccountID,
       a.FirstName,
       a.LastName,
       a.DisplayName,
       a.Password,
       a.AuthenticationSignInName,
       a.AuthenticationTypeID,
       a_type.AuthenticationTypeName
  FROM Auth.Accounts AS a
       INNER JOIN Auth.AuthenticationType AS a_type
          ON a.AuthenticationTypeID = a_type.AuthenticationTypeID
 WHERE a.AuthenticationSignInName = @UserName;